package diliuzhou;

import java.util.Scanner;

class ArrayUtils{
	public static class PairResult{
		private double min;
		private double max;
		public PairResult(double min, double max) {
			this.min = min;
			this.max = max;
		}
		@Override
		public String toString() {
			return "PairResult [min=" + min + ", max=" + max + "]";
		}
	}
	
	public static PairResult findMinMax(double[] values){
		double min = values[0];
		double max = values[0];
		for (double d : values) {
			if (min > d) min = d;
			if (max < d) max = d;
		}
		return new PairResult(min,max);
	}
}

public class Arr {

	public static void main(String[] args) {
		Scanner sc=new Scanner (System.in);
		int n=sc.nextInt();
		double[] doubles=new double[n];
		for (int i = 0; i < n; i++) {
			doubles[i]=sc.nextDouble();
		}
		ArrayUtils.PairResult p=ArrayUtils.findMinMax(doubles);
		System.out.println(p);
		System.out.println(ArrayUtils.PairResult.class);
		sc.close();
	}

}
